/**
 * 
 */
package com.fc.push.handler.pub.verify;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fc.commons.HttpUtil;
import com.fc.commons.JsonUtils;
import com.fc.commons.security.MD5Util;

/**
 * @author Administrator
 *
 */
public class UnPublishServiceRegisterHandlerTest2 {
	String module = "1";
	String order = "3";
	String appkey = "4d9b36ffde2746f9a38a08e2e1a1b1c5";
	String uid = "1";
	JSONObject jsonParam;
	
	private static final String DEFAULT_ENCODE = "utf-8";
	
	public static final String APPKEY = "appkey";
	public static final String UID = "uid";
	public static final String TOKEN = "token";
	public static final String MODULE = "module";
	public static final String ORDER = "order";
	private static final String PLATFORM = "platform";
	
	
	public UnPublishServiceRegisterHandlerTest2(){
		
		jsonParam = new JSONObject();
		jsonParam.put(MODULE, module);
		jsonParam.put(ORDER, order);
//		jsonParam.put("device_id","867840020273125");
		
//		jsonParam.put(TOKEN,"8b19acc5f03858159ff1d801cf7de6d88f82444a1314cacddb67f7f62cbf87f");
		jsonParam.put("clientid", "8c0009f3352fe2ee");
//		String[] taglist = new String[]{"IOS","MESSAGE"};
//		
//		jsonParam.put("tag", taglist);
		
	}
	//http://120.236.176.179:8088/fcpserver/push
	//http://ms.carisok.com/fcpserver/push
	//4d9b36ffde2746f9a38a08e2e1a1b1c5
	//bcd2041e63e5476f82e94159ca23e3b1
	public void run(){
		try {
			
			jsonParam.put(APPKEY,"febec640cf1c47719f18c69d49de0279");
			System.out.println(jsonParam);
			System.out.println(HttpUtil.doPost("http://ms.carisok.com/fcpserver/push", jsonParam));
			
			
//			appkey = "4d9b36ffde2746f9a38a08e2e1a1b1c5";
//			jsonParam.remove(APPKEY);
//			jsonParam.put(APPKEY,appkey);
//			System.out.println(jsonParam);
//			System.out.println(HttpUtil.doPost("http://ms.carisok.com/fcpserver/push", jsonParam));
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
//	body[{"platform":"IOS","module":"1","order":"2","token":"e1ccb571850e1789c4bf80fd3a7f852d9c141b7606d3cd244c4c0d78ec748d5d","tag":["IOS","MESSAGE"],"appkey":"bcd2041e63e5476f82e94159ca23e3b1"}]
	
	public static void main(String[] args){
		new UnPublishServiceRegisterHandlerTest2().run();
	}
}
